import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

import 'app.dart';
import 'http/dio_instance.dart';

// void main() {
//   DioInstance.instance().initDio(baseUrl: "https://www.wanandroid.com/");
//   runApp (MyApp());
// }
void main() {
  DioInstance.instance().initDio(baseUrl: "https://www.wanandroid.com/");
//如果size是0，则设置回调，在回调中runApp
  if(window.physicalSize.isEmpty){
    window.onMetricsChanged = (){
      //在回调中，size仍然有可能是0
      if(!window.physicalSize.isEmpty){
        window.onMetricsChanged = null;
        runApp(const MyApp());
      }
    };
  } else{
    //如果size非0，则直接runApp
    runApp(const MyApp());
  }
}